// pages/details/details.js
var app = getApp(); //获取应用实例
const pathLevel = '../../../../'; //路径层级
const quote = require(pathLevel + 'utils/quoteConfig.js') //统一引入文件

const recorder = app.globalData.recorder; //引入录音对象
const innerAudioContext = app.globalData.innerAudioContext; //引入音频播放器

const tools = quote.tools;
const mta = quote.mta;
const api = quote.api;
const util = quote.util;
const path = quote.paths;

Page({

    /**
     * 页面的初始数据
     */
    data: {
        path: path,
    },

    onLoad(options) {

    },

    onReady() {

    },

    // 保存二维码图片
    saveQRcode() {
        console.log('保存二维码')
        wx.getImageInfo({
            src: 'https://video.acadsoc.com.cn/iesfiles/Cover/20180314/groupCode.jpg', //`/${path.images}/QRcode.jpg`,
            success: (res) => {
                console.log('图片地址', res.path)
                var path = res.path;
                wx.saveImageToPhotosAlbum({
                    filePath: path, //path
                    success: (ret) => {
                        console.log(ret)
                        wx.showToast({
                            title: '保存至相册成功',
                            icon: 'success',
                            duration: 1000
                        })
                    },
                    complete: function(r) {
                        console.log('保存图片完成', r)
                    }
                })
            }
        })
    },

    //复制微信号
    saveWechatId() {
        wx.setClipboardData({
            data: 'Abbey886',
            success: (res) => {
                wx.getClipboardData({
                    success: (res) => {
                        console.log(res)
                        wx.showToast({
                            title: '复制成功',
                            icon: 'success',
                            duration: 1000
                        })
                    }
                })
            }
        })
    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {

    },
})